/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Automota_View.java
 *
 * Created on 12-oct-2012, 11:50:51
 */
package jautomata;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author JorgeLuis
 */
public class Automata_View extends javax.swing.JFrame {

    /** Creates new form Automota_View */
    public Automata_View() {
        initComponents();
        this.setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel1 = new org.edisoncor.gui.panel.Panel();
        panelRound1 = new org.edisoncor.gui.panel.PanelRound();
        jLabel4 = new javax.swing.JLabel();
        btn_verificar = new org.edisoncor.gui.button.ButtonPopup();
        txt_palabra_reservada = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        txt_resultado = new javax.swing.JTextArea();
        btn_Nuevo = new org.edisoncor.gui.button.ButtonPopup();
        jSeparator3 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator4 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Principal");

        panel1.setColorPrimario(new java.awt.Color(97, 129, 197));
        panel1.setColorSecundario(new java.awt.Color(97, 129, 197));
        panel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelRound1.setColorPrimario(new java.awt.Color(212, 209, 132));
        panelRound1.setColorSecundario(new java.awt.Color(212, 209, 132));

        jLabel4.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel4.setText("PALABRA:");

        btn_verificar.setText("VERIFICAR");
        btn_verificar.setFont(new java.awt.Font("Arial", 0, 14));
        btn_verificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_verificarActionPerformed(evt);
            }
        });

        txt_palabra_reservada.setFont(new java.awt.Font("Arial", 0, 14));
        txt_palabra_reservada.setBorder(null);
        txt_palabra_reservada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txt_palabra_reservadaActionPerformed(evt);
            }
        });
        txt_palabra_reservada.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_palabra_reservadaKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txt_palabra_reservadaKeyReleased(evt);
            }
        });

        jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

        txt_resultado.setColumns(10);
        txt_resultado.setFont(new java.awt.Font("Arial", 1, 16));
        txt_resultado.setRows(2);
        jScrollPane1.setViewportView(txt_resultado);

        btn_Nuevo.setText("Nuevo");
        btn_Nuevo.setFont(new java.awt.Font("Arial", 0, 14));
        btn_Nuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_NuevoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelRound1Layout = new javax.swing.GroupLayout(panelRound1);
        panelRound1.setLayout(panelRound1Layout);
        panelRound1Layout.setHorizontalGroup(
            panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound1Layout.createSequentialGroup()
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelRound1Layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 409, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(panelRound1Layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txt_palabra_reservada, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(panelRound1Layout.createSequentialGroup()
                        .addGap(119, 119, 119)
                        .addComponent(btn_verificar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btn_Nuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(33, Short.MAX_VALUE))
        );
        panelRound1Layout.setVerticalGroup(
            panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound1Layout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(txt_palabra_reservada, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_verificar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_Nuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(18, Short.MAX_VALUE))
        );

        panel1.add(panelRound1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, -1, 250));
        panel1.add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(37, 10, 500, 10));
        panel1.add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(202, 11, -1, 10));
        panel1.add(jSeparator4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, 500, 10));

        jLabel2.setFont(new java.awt.Font("Arial", 1, 18));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("COMPROBAR PALABRAS RESERVADAS (for Y float)");
        panel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, -1, -1));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, 577, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btn_verificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_verificarActionPerformed
    Controller_Automata controller = new Controller_Automata();
    controller.comprobar_palabra_reservada(txt_palabra_reservada, txt_resultado);
    // TODO add your handling code here:
}//GEN-LAST:event_btn_verificarActionPerformed
    
private void txt_palabra_reservadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt_palabra_reservadaActionPerformed
    btn_verificarActionPerformed(evt);// TODO add your handling code here:
}//GEN-LAST:event_txt_palabra_reservadaActionPerformed

private void txt_palabra_reservadaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_palabra_reservadaKeyPressed

    // TODO add your handling code here:
}//GEN-LAST:event_txt_palabra_reservadaKeyPressed

private void txt_palabra_reservadaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_palabra_reservadaKeyReleased
btn_verificarActionPerformed(null);
    // TODO add your handling code here:
}//GEN-LAST:event_txt_palabra_reservadaKeyReleased

private void btn_NuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_NuevoActionPerformed
Controller_Automata controller = new Controller_Automata();
controller.nuevo(txt_palabra_reservada);
    // TODO add your handling code here:
}//GEN-LAST:event_btn_NuevoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(Automata_View.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(Automata_View.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(Automata_View.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(Automata_View.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
        try {
//            // Set System L&F
            UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
        } catch (UnsupportedLookAndFeelException e) {
            // handle exception
        } catch (ClassNotFoundException e) {
            // handle exception
        } catch (InstantiationException e) {
            // handle exception
        } catch (IllegalAccessException e) {
//            // handle exception
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            
            public void run() {
                new Automata_View().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.edisoncor.gui.button.ButtonPopup btn_Nuevo;
    private org.edisoncor.gui.button.ButtonPopup btn_verificar;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private org.edisoncor.gui.panel.Panel panel1;
    private org.edisoncor.gui.panel.PanelRound panelRound1;
    private javax.swing.JTextField txt_palabra_reservada;
    private javax.swing.JTextArea txt_resultado;
    // End of variables declaration//GEN-END:variables
}
